# -*- coding: utf-8 -*-
"""
file:ch2_1酒精浓度稀释
author: Fuwen
time: 2022/7/15 6:47
software:PyCharm
"""
# 高粱酒初始酒精浓度：58
# 每次倒出一半，再兑水，浓度稀释二分之一
# 循环处理10次

import matplotlib.pyplot as plt

alchol = 58

X = []
y = []
for x in range(0, 11):
    X .append(x)
    if x > 0:
        alchol *= 1/2
    y.append(alchol)
    print('当x = {}， 酒精浓度 = {:.2f}'.format(x, alchol))
plt.axis([0, 12, 0, 60])
plt.plot(X, y)
plt.xlabel('Time')
plt.ylabel('Alcohol')
plt.grid()
plt.show()

'''
x --> 无穷，
y --> 0，
极限为0
'''